package com.shinlooker.hencoder.utils;

import com.shinlooker.hencoder.utils.DataConvertUtil;

import java.security.MessageDigest;

public class Sha1Util {
    public static String encryptToSHA(String pbkStr) {
        try {
            MessageDigest alga = MessageDigest.getInstance("SHA-1");
            byte[] digesta = alga.digest(pbkStr.getBytes("UTF-8"));
            return DataConvertUtil.bytesToHexString(digesta);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
